<style type="text/css">
    *{margin:0px;padding:0px;}
    .tabbox{margin:10px;}
    .tabbox ul{list-style:none;display:table;}
    .tabbox ul li{float:left;width:100px;line-height:30px;padding-left:8px;border:1px solid #aaccff;margin-right:-1px;cursor:pointer;}
    .tabbox ul li.active{background-color:#e73839;color:white;font-weight:bold;}
    .tabbox .content{border:1px solid #aaccff;padding:10px;}
    .tabbox .content>div{display:none;}
    .tabbox .content>div.active{display:block;}
</style>
<div class="layuimini-container">
    <form id="app-form" class="layui-form layuimini-form">

        <div class="tabbox">
            　　<ul>
            {foreach $row.evaluate as $k=>$v}
            　　　　<li style="width: fit-content;font-family:SimHei;font-weight: bold;font-size:20px;display:inline;margin-right: 5px;" {if $k eq 0} class="active"{/if}>{$v.star_name}       {$v.scores|default=0}分</li>
            {/foreach}
            　　</ul>
            <div class="content">
                {foreach $row.evaluate as $k=>$v}
            　　<div {if $k eq 0}class="active"{/if}>
            　　　　 <div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">评价内容</label>
                            <div class="layui-input-block">
                                <textarea name="content" rows="5" class="layui-textarea editor" 评价内容 placeholder="请输入评价内容" readonly='true'>{$v.content|raw|default=''}</textarea>
                            </div>
                        </div>


                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label required">图片</label>
                        {if $v.image}
                        <div class="layui-input-block layuimini-upload">
                            <input name="image_{$k}" class="layui-input layui-col-xs6"   placeholder="请上传图片" value="{$v.image|default=''}" readonly='true'>
                            <div class="layuimini-upload-btn">
                                <span hidden=""><a class="layui-btn" data-upload="image_{$k}" data-upload-number="more" data-upload-exts="png|jpg|ico|jpeg" data-upload-icon="image"><i class="fa fa-upload"></i> 上传</a></span>
                                <span hidden><a class="layui-btn layui-btn-normal" id="select_image_{$k}" data-upload-select="image_{$k}" data-upload-number="more" data-upload-mimetype="image/*"><i class="fa fa-list"></i> 选择</a></span>
                            </div>
                        </div>
                        {else}
                        <span>暂无相关内容</span>
                        {/if}
                    </div>

                <div class="layui-form-item">
                    <label class="layui-form-label required">视频</label>
                    {if $v.video}
                    <div class="layui-input-block layuimini-upload">
                        <input name="video_{$k}" class="layui-input layui-col-xs6"   placeholder="请上传视频" value="{$v.video|default=''}" readonly='true'>

                        {if $videos = explode('|',$v.video)}{/if}
                        {foreach  $videos as $kk =>$vv}
                        <video width="100" height="100" controls="controls" autoplay="autoplay">
                            <source id="show_video_{$kk}" src="{$vv|default=''}" type="video/mp4" />
                        </video>
                        {/foreach}
                    </div>
                    {else}
                        <span>暂无相关内容</span>
                    {/if}
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">匿名</label>
                    <div class="layui-input-block">
                        <input type="radio" name="isanonymous_{$k}" lay-skin="primary"   value="1" title="是" disabled="disabled" {if $v.isanonymous eq 1}checked="" {/if}>
                    </div>
                </div>

            　　</div>
                {/foreach}

        </div>

        <div class="hr-line"></div>
        <div style="height: 500px">
            <div><h2 style="text-align: center;">追加评价</h2></div>
           <hr>
            <table width="100%" >

                <tr>
                    <td>序号</td>
                    <td>头像</td>
                    <td>昵称</td>
                    <td>班级</td>
                    <td>学生姓名</td>
                    <td>内容</td>
                    <td>评价时间</td>
                </tr>
                {foreach $zhuiping as $k=> $v}
                    <tr>
                        <td>{$k +1}</td>
                        <td><img src="{$v.zhuipingUsers['head_pic']}" style="width: 50px;height: 50px"></td>
                        <td>{$v.zhuipingUsers['nickname']}</td>
                        <td>{$v.zhuipingEvaluation['class_name']}</td>
                        <td>{$v.zhuipingEvaluation['student_name']}</td>
                        <td>{$v.content}</td>
                        <td>{$v.create_time}</td>
                    </tr>
                {/foreach}
            </table>
        </div>

    </form>
</div>
<!--<script src="/static/plugs/layui-v2.5.6/layui.js"></script>-->
<script src="/static/plugs/jquery-3.4.1/jquery-3.4.1.min.js"></script>
<script type="text/javascript">
    $(function ()
    {
        $(".tabbox li").click(function ()
        {

            if($(this).text() == '*       *分'){

                layer.msg('用户已匿名评价不可查看',{icon: 2, time: 2000});
                return false;
            }
            //获取点击的元素给其添加样式，讲其兄弟元素的样式移除
            $(this).addClass("active").siblings().removeClass("active");
            //获取选中元素的下标
            var index = $(this).index();
            $(this).parent().siblings().children().eq(index).addClass("active")
                .siblings().removeClass("active");
        });
    });

</script>
